package main

import (
	"net"
	"net/rpc"
	"traning/rpc_traning/rpc_frame/handler"
	"traning/rpc_traning/rpc_frame/server_proxy"
)


func main() {
	// 监听端口
	client, _ := net.Listen("tcp", ":1234")
	// 注册服务
	err := server_proxy.RegisterHelloService(&handler.HelloService{})
	if err != nil {
		panic(any(err))
	}
	// 启动服务
	for {
		conn, _ := client.Accept()
		go rpc.ServeConn(conn)
	}
}
